<template>
	<div>
		<div class="wdBox" v-for="(item,index) in quesData" :key="index" @click="rmwdCik(item)">
			<div class="wdAvatar flex-h">
				<img :src="item.author.avatar?item.author.avatar:usersImg" alt="">
				<span class="flex1 wdsp"><b>{{item.author.name}}</b><i>{{ item.createTime }}</i></span>
			</div>
			<div class="wdTil">
				<span>{{item.title}}</span>
			</div>
			<div v-if="item.answer_count > 0">
				<div class="wdNum">{{item.answer_count}}条回答</div>			
				<div class="wdDetail" v-for="(its,$index) in item.answer" :key="$index+10">
					<div class="wdDeBox" >
						<div class="deTop">
							<img :src="its.user_avatar?its.user_avatar:usersImg" alt="">
							<b>{{its.user_name}}</b>
						</div>
						<span class="quesDes">{{its.text}}</span>
					</div>

				</div>
			</div>

		</div>
	</div>
</template>

<script>
	import {format
	} from '~/plugins/filter';
	export default {
		props: {
			quesData: Array
		},

		data() {
			return {
				usersImg:require('~/static/usermoren.png')
			};
		},
		computed: {

		},
		mounted: function() {
		
		},
		methods: {
			rmwdCik(its){
				this.$emit('listToRewd',its)
				
			}

		}
	};
</script>


<style scoped lang="less">
	.wdBox {
		width: 6.9rem;
		// height: 5.6rem;
		height: auto;
		margin: 0.2rem auto 0;
		border-radius: 0.1rem;
		border: 1px solid rgba(238, 238, 238, 1);
		overflow: hidden;
		padding-bottom: 0.2rem;
		.wdAvatar {
			width: 100%;
			height: 1.4rem;
			padding: 0.3rem;
			box-sizing: border-box;

			img {
				width: 0.8rem;
				height: 0.8rem;
				border-radius: 50%;
				display: block;
			}

			.wdsp {
				padding-left: 0.2rem;
				box-sizing: border-box;

				b,
				i {
					display: block;
				}

				b {
					font-size: 0.26rem;
					line-height: 0.41rem;
					font-weight: bold;
					color: rgba(34, 34, 34, 1);

				}

				i {
					font-size: 0.24rem;

					font-weight: 500;
					color: rgba(187, 187, 187, 1);
					line-height: 0.4rem;
				}
			}
		}

		.wdNum,
		.wdDetail,
		.wdTil {
			width: 100%;
			height: auto;
			padding: 0 0.3rem;
			box-sizing: border-box;
		}

		.wdTil {


			span {
				font-size: 0.3rem;

				font-weight: 600;
				color: rgba(34, 34, 34, 1);
				line-height: 0.45rem;
			}
		}



		.wdNum {
			font-size: 0.26rem;
			height: 0.8rem;
			font-weight: 500;
			color: rgba(153, 153, 153, 1);
			line-height: 0.8rem;
			text-align: right;
		}

		.wdDetail {

			.wdDeBox {
				width: 100%;
				height: 1.95rem;
				background: rgba(250, 250, 250, 1);
				border-radius: 0.04rem;
				padding: 0.2rem;
				box-sizing: border-box;

				.deTop {
					img {
						width: 0.5rem;
						height: 0.5rem;
						border-radius: 50%;
						display: inline-block;
						vertical-align: middle;
					}

					b {
						display: inline-block;

						font-size: 0.26rem;

						font-weight: bold;
						color: rgba(34, 34, 34, 1);
						vertical-align: middle;
						margin-left: 0.15rem;
					}
				}

				.quesDes {
					font-size: 0.26rem;
					margin-top: 0.15rem;
					font-weight: 500;
					color: rgba(153, 153, 153, 1);
					line-height: 0.4rem;
					overflow: hidden;
					text-overflow: ellipsis;
					display: -webkit-box;
					-webkit-line-clamp: 2;
					-webkit-box-orient: vertical;
				}
			}
		}
	}
</style>
